import request from '@/utils/request'

/**
 * 路由定义（主进程与渲染进程通信频道定义）
 */
const ipcApiRoute = {
  checkHttpServer: 'controller/wallpaper/checkHttpServer',

  addFile: 'controller/wallpaper/addFile',
  getFile: 'controller/wallpaper/getFile',
  deleteFile: 'controller/wallpaper/deleteFile',

  addTag: 'controller/wallpaper/addTag',
  queryAllTag: 'controller/wallpaper/queryAllTag',
  deleteTag: 'controller/wallpaper/deleteTag',
}

/**
 * http表单上传-post
 * @param url
 * @param params
 */
const httpPostForm = (url: string, params: any) => {
  return request.postForm(url, params, {
    headers: { 'Content-Type': 'multipart/form-data' },
  })
}
/**
 * http get
 * @param url
 * @param params
 */
const httpGet = (url: string, params?: any) => {
  return request.get(url, params)
}

export { ipcApiRoute, httpPostForm, httpGet }
